/**
 * 
 */
package org.mtdownload.dialogs.preferences;

import javax.swing.JPanel;

/**
 * @author sergiu
 *
 */
public abstract class PreferencePanel extends JPanel {

	private boolean dirty=false;	
	private PreferencesChangedListener preferencesListener=null;
	
	
	/**
	 * Constructor that has the name specified.
	 */
	public PreferencePanel(String name) {		
		setName(name);
	}
	
	public abstract void applyChanges();
	
	
	
	public String toString(){
		return getName();
	}

	/**
	 * @return Returns the dirty.
	 */
	public boolean isDirty() {
		return dirty;
	}
	

	/**
	 * @param dirty The dirty to set.
	 */
	public void setDirty(boolean dirty) {
		this.dirty = dirty;
	}

	/**
	 * @return Returns the preferencesListener.
	 */
	public PreferencesChangedListener getPreferencesListener() {
		return preferencesListener;
	}
	

	/**
	 * @param preferencesListener The preferencesListener to set.
	 */
	public void setPreferencesListener(
			PreferencesChangedListener preferencesListener) {
		this.preferencesListener = preferencesListener;
	}
	
	
}
